package com.cnxdc.demo.annotations;

import com.cnxdc.demo.validations.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(
        validatedBy = {StateValidation.class}
)
public @interface State {
    String message() default "{文章的状态只能是'已发布'或'草稿'}";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
